import request from '@/utils/request'
import upload from '@/utils/upload.js'

export const getCaptainTask = (data) => {
	return request({
		url: '/app/shippingWaybillShip/getCaptainWaybillShipInfoPage',
		data: data,
		method: 'post'
	})
}

// 查找个人信息
export const getInfo = (query) => {
	return request({
		url: '/app/captain/getCaptain',
		params: query,
		method: 'get'
	})
}

// 已关联企业列表
export const Entlist = () => {
	return request({
		url: '/app/captain/getRelateEnt',
		method: 'get',
	})
}

// 去认证
export const toAuth = (data) => {
	return request({
		url: '/app/captain/userUpdateCaptain',
		data,
		method: 'post'
	})
}

// 查询企业是否被关联
export const haslinkEnt = (relateEntCode) => {
	return request({
		url: '/app/captain/verifyCaptainHasRelateEnt',
		method: 'post',
		data: {
			relateEntCode
		}
	})
}

// 关联企业
export const linkEnt = (relateEntCode) => {
	return request({
		url: '/app/captain/userCaptainCode',
		data: {
			relateEntCode
		},
		method: 'post'
	})
}

// 修改委托人证件信息
export const updateAssignorInfo = (data) => {
	return request({
		url: '/app/assignor/updateUserInfo',
		method: 'post',
		data
	})
}

// 修改船长协议
export const getAgreement = (data) => {
	return request({
		url: '/app/captain/getRelateEnt',
		method: 'get',
		data
	})
}

// 获取企业
export const getEnt = (data) => {
	return request({
		url: '/app/captain/getRelateEnt',
		method: 'get',
		data
	})
}